import { createRouter, createWebHistory } from 'vue-router'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
NProgress.configure({
  easing: 'ease', // 动画方式
  speed: 500, // 递增进度条的速度
  showSpinner: false, // 是否显示加载 icon
  trickleSpeed: 100, // 自动递增间隔
  minimum: 0.3 // 初始化时的最小百分比
})
export const router = createRouter({
  history: createWebHistory(`/svgtool`),
  routes:[
    {
      path: '/welldetail',
      name: 'D3Draw',
      meta: '首页',
      component: () => import('@/views/D3Draw')
    },
    {
      path:'/trend',
      name:'trend',
      meta:'trend',
      component:() => import('@/views/TheTrend.vue')
    },
    {
      path:'/trendcomparison',
      name:'TrendComparison',
      meta:'trendcomparison',
      component:()=>import('@/views/TrendComparison.vue')
    },
     {
      path:'/trendCanBeStored',
      name:'TrendCanBeStored',
      meta:'trendCanBeStored',
      component:()=>import('@/views/TrendCanBeStored.vue')
    },
       {
      path:'/trendCanPreference',
      name:'TrendCanPreference',
      meta:'trendCanPreference',
      component:()=>import('@/views/TrendCanPreference.vue')
    }
  ],
  scrollBehavior: () => ({ left: 0, top: 0 })
})

router.afterEach(() => {
  NProgress.done() // 进度条结束
})

export function setupRouter(app) {
  app.use(router)
}

